
function miniscene(rawk)
{
	this.inprog = false;
	this.happened = false;
	this.inprog = false;
	this.play = eval(rawk);
	this.pos = 0;
	this.evq = new Array();
	this.proceed = false;
}

miniscene.prototype.ateq = function(junk)
{
	this.evq[this.evq.length] = junk;
}

var timewarping = new miniscene();
var domaguys = new miniscene("domadudes");
var tvblock = new miniscene("superslam");
var brook_invasion = new miniscene("run_away_idiot");
var rumwalk = new miniscene("check_out_babes");
var rumsbattle = new miniscene("fightyaforit");
var pirateparty = new miniscene("swagrindrunks");
var eavesdrop = new miniscene("lunchbreak2");
var farmandog = new miniscene("farman_sprinkle");
var findanotherway = new miniscene("tellthemech");
var pushmtek = new miniscene("pushthatmtekbaby");
var turtlelude = new miniscene("renchyturtle");
var scenetrig321_bX14 = new miniscene("noticeturtle");

function domadudes()
{
	crdu1 = "SENTRY: Man, I hate Kefka!  I hate the\nEmpire!  This sucks!";
	fixta2 = "FIXER: You clutz! Hold still or we'll never\nfinish!";
	SetTalkActivationKey(KEY_6);
	dudeY = GetPersonY('fixer');
	checkidle = false;
	
	domaguys.ateq("");
	domaguys.ateq("DetachInput();");
	
		if (GetPersonDirection(thePC.name) == "north") {var nw = true; domaguys.ateq("SetPersonDirection('crouch', 'south');");}
		if (GetPersonDirection(thePC.name) == "west") {var nw = true; domaguys.ateq("SetPersonDirection('crouch', 'east');");}
		if (GetPersonDirection(thePC.name) == "east") { var nw = false; domaguys.ateq("SetPersonDirection('crouch', 'west');"); }
				
	domaguys.ateq("fixer.dirs = new Array('w');");
	domaguys.ateq("SetPersonX('fixer', GetPersonX('fixer')" + ((nw) ? "-" : "+") + "5); SetPersonY('fixer', GetPersonY('fixer')-7);");
	domaguys.ateq(""); domaguys.ateq("");
	domaguys.ateq("SetPersonDirection('fixer', '" + ((nw) ? "ouch2" : "ouch") + "');");
	domaguys.ateq(""); domaguys.ateq("");
	for (var r=0; r<10; r+=2)
	{
		domaguys.ateq("SetPersonX('fixer', GetPersonX('fixer')" + ((nw) ? "-" : "+") + "4); SetPersonY('fixer', " + (.238*(r*r)+dudeY) + ");");
		domaguys.ateq("");	//single frame delay
	}
	domaguys.ateq("SetPersonDirection('fixer', 'pushed');");
	domaguys.ateq("talkjunk(crdu1); dontproceed=true;");
	domaguys.ateq("domaguys.proceed = false; SetDelayScript(30, 'domaguys.proceed=true');");
	domaguys.ateq("SetPersonDirection('fixer', 'crouch');");
	domaguys.ateq("domaguys.proceed = false; SetDelayScript(20, 'domaguys.proceed=true');");
	domaguys.ateq("SetPersonDirection('fixer'," + ((nw) ? "'east'" : "'west'") + ");");
	domaguys.ateq("domaguys.proceed = false; SetDelayScript(20, 'domaguys.proceed=true');");
	domaguys.ateq("talkjunk(fixta2); dontproceed=true;");
	domaguys.ateq("IgnoreTileObstructions('fixer', true);");
	domaguys.ateq("SetPersonScript(fixer.name, 4, 'if (fixer.mark >= 12){ fixer.step++; fixer.mark=0;} walkgay(fixer, fixer.dirs[fixer.step]);');");
	domaguys.ateq("domaguys.proceed=false; fixer.step=0; fixer.mark=0; fixer.dirs = new Array(" + ((nw) ? "'fr','r'," : "'fl','l',") + "'domaguys.proceed=true;');");
	domaguys.ateq("SetPersonDirection('crouch', 'crouch');");
	domaguys.ateq("domaguys.proceed = false; SetDelayScript(15, 'domaguys.proceed=true');");
	domaguys.ateq("SetPersonX('fixer',328); SetPersonY('fixer',792); SetPersonDirection('fixer', 'crouch');");
	domaguys.ateq("domaguys.proceed = false; SetDelayScript(25, 'domaguys.proceed=true');");
	domaguys.ateq("SetPersonDirection('fixer', 'fix'); fixer.dirs = new Array('SetPersonFrame(\"fixer\", 1);','w','w', 'SetPersonFrame(\"fixer\", 2);','w','w');");
	domaguys.ateq("SetPersonLayer('fixer',1); SetPersonLayer('crouch', 1); SetPersonLayer(thePC.name, 1);");
	domaguys.ateq("SetPersonScript(fixer.name, 4, 'if (fixer.step > fixer.dirs.length) fixer.step=0; walkgay(fixer, fixer.dirs[fixer.step]);');");
	domaguys.ateq("AttachInput(thePC.name);");
	domaguys.ateq("domaguys.proceed = false; SetDelayScript(15, 'domaguys.proceed=true;');");
	domaguys.ateq("idletime = GetTime();");
	domaguys.ateq("SetTalkActivationKey(key_talk); checkidle=true; domaguys.pos=0; domaguys.inprog=false; domaguys.proceed=false; domaguys.evq = new Array(); remove(domaguys);");
	
	subevq.push(domaguys);
	domaguys.inprog = true;
	domaguys.proceed = true;
}


function superslam()
{
	if (eventBox['furniture_mission'].inprog) return;
	DetachInput();
	chris.toobusy = true;
	if (GetPersonDirection(thePC.name)=="east")
	{
		for (var r=0; r<=(6*16+7 - GetPersonX(thePC.name)); r++)
		QueuePersonCommand(thePC.name, COMMAND_MOVE_EAST, false);
		tvblock.proceed = false;
		QueuePersonScript(thePC.name, 'SetPersonX(thePC.name, 6*16+7);SetPersonFrame(thePC.name,0); tvblock.proceed=true;',false);
	}
	else 
	{
		SetPersonX(thePC.name, 6*16+7);
		SetPersonFrame(thePC.name,0);
		tvblock.proceed = true;
	}
	IgnoreTileObstructions('chris', true);
	
	var cheeser = LoadSpriteset(thePC.rss);
	for (var f=0; f<cheeser.directions.length; f++)
	{
		if (cheeser.directions[f].name == "down2") var doodlyda2 = '"down2"';
		if (cheeser.directions[f].name == "crouch") var doodlyda3 = '"crouch"';
		if (cheeser.directions[f].name == "owch") {var doodlyda = '"owch"'; break;}
		if (cheeser.directions[f].name == "hurt"){ var doodlyda = '"hurt"'; break}
	}
	tvblock.ateq("");
	tvblock.ateq("");
	tvblock.ateq("SetPersonScript('chris', 4, 'walkgay(chris, chris.dirs[chris.step]);');");
	tvblock.ateq("tvblock.proceed=false; chris.dirs = new Array('fd','d','SetPersonFrame(chris.name,0);', 'fr','tvblock.proceed=true;');chris.step=0; chris.mark=0;");
	tvblock.ateq("tvblock.proceed=false; SetDelayScript(15, 'tvblock.proceed=true;');");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1); SetPersonDirection('chris', 'north');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1); SetPersonDirection('chris', 'west');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1); SetPersonDirection('chris', 'south');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1); SetPersonDirection('chris', 'east');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')-1); SetPersonDirection('chris', 'north');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'west');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'south');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'east');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'north');");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'west');");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1);");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'south');");
	tvblock.ateq("SetPersonX('chris', GetPersonX('chris')+1); SetPersonDirection('chris', 'east');");
	tvblock.ateq("if ("+doodlyda+") SetPersonDirection(thePC.name,"+doodlyda+"); SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-1);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-1);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-1);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2); SetPersonY(thePC.name, GetPersonY(thePC.name)-1);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)+2);");
	
	tvblock.ateq("doorclose.play(false);");
	tvblock.ateq("tvblock.proceed=false; SetDelayScript(10, 'tvblock.proceed=true;');");
	
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-2); SetPersonY(thePC.name, GetPersonY(thePC.name)+1);");
	tvblock.ateq(";"); 
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-2); SetPersonY(thePC.name, GetPersonY(thePC.name)+1);");
	tvblock.ateq(";"); 
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-2); SetPersonY(thePC.name, GetPersonY(thePC.name)+1);");
	tvblock.ateq(";");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-2); SetPersonY(thePC.name, GetPersonY(thePC.name)+1);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-2); SetPersonY(thePC.name, GetPersonY(thePC.name)+1);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-2); SetPersonY(thePC.name, GetPersonY(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-1); SetPersonY(thePC.name, GetPersonY(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-1); SetPersonY(thePC.name, GetPersonY(thePC.name)+2);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-1); SetPersonY(thePC.name, GetPersonY(thePC.name)+2);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-1); SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-1); SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-1); SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+3);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+4);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+4);");
	tvblock.ateq("																SetPersonY(thePC.name, GetPersonY(thePC.name)+4);");
	if (doodlyda2) tvblock.ateq("SetPersonDirection(thePC.name,"+doodlyda2+");");
	tvblock.ateq("chris.dirs = new Array('fu','u','SetPersonFrame(chris.name,0);','fd'); chris.step=0; chris.mark=0;");
	tvblock.ateq("tvblock.proceed=false; SetDelayScript(30, 'tvblock.proceed=true;');");
	if (doodlyda3)
	{	tvblock.ateq("SetPersonDirection(thePC.name,"+doodlyda3+");");
		tvblock.ateq("tvblock.proceed=false; SetDelayScript(30, 'tvblock.proceed=true;');"); 
	}
	tvblock.ateq("SetPersonDirection(thePC.name, 'west');");
	tvblock.ateq("AttachInput(thePC.name);");
	tvblock.ateq("tvblock.pos=0; tvblock.inprog=false; tvblock.proceed=false; tvblock.evq = new Array(); remove(tvblock);");
	
	subevq.push(tvblock);
	tvblock.inprog = true;

}

function run_away_idiot()
{
	brook_invasion.ateq("");
	brook_invasion.ateq("ClearPersonCommands(thePC.name); DetachInput(); walking=false; SetPersonFrame(thePC.name,0); DetachCamera();");
	brook_invasion.ateq("SetPersonScript('queery', 4, 'walkgay(queery, queery.dirs[queery.step]);');");
	brook_invasion.ateq("queery.dirs = new Array('fl','w','fd','w','fl','w','fr','w','fl','w','fd', ';',';', 'fr', ';',';', 'fl', ';',';', 'fu', ';',';', 'fd', ';',';', 'fl', ';',';', 'queery.step=0;'); queery.step=0;");
	brook_invasion.ateq("brook_invasion.proceed = false; dontproceed=true; camerapanx(GetPersonX('queery')+(GetPersonX(thePC.name)-GetPersonX('queery'))/2,1);");	//pan to half way point of queer & ya
	brook_invasion.ateq("winy=172; dontproceed=true; talkjunk('MAN: AHH!! /wPirates are invading!\\nAlbrook\\'s not safe anymore!');");
	brook_invasion.ateq("SetPersonSpeed('queery', 2);");
	brook_invasion.ateq("brook_invasion.proceed = false; queery.dirs = ['fr','r','r','fu','u','SetPersonLayer(queery.name,0);','dooropen.play(false); SetTile(44, 87, 1, 397);SetTile(44, 88, 1, 428);','u','doorclose.play(false); SetTile(44,87,1,396);SetTile(44,88,1,427);','brook_invasion.proceed=true;']; queery.step=0; queery.mark=0;");
	brook_invasion.ateq("DestroyPerson('queery'); winy = ybor; people=GetPersonList();");
	brook_invasion.ateq("brook_invasion.proceed = false; dontproceed=true; camerapanx(GetPersonX(thePC.name),1);");
	brook_invasion.ateq("AttachInput(thePC.name); AttachCamera(thePC.name);");
	brook_invasion.ateq("brook_invasion.happened=true; remove(brook_invasion);");
	
	subevq.push(brook_invasion);
	brook_invasion.inprog = true;
	brook_invasion.proceed = true;
}

function check_out_babes()
{
	rumwalk.nofadepro = true;	//dont proceed on fade in/outs
	rumwalk.clean = true;	//dont screw w/ input stuff (shoes)
	rumwalk.happened=true;
	rumwalk.ateq("");
	rumwalk.ateq("rumwalk.proceed=false; rummy.dirs = ['fu','u','u','fl','l','ul','ul','ul','l','fu','u','u','fr','r','r','r','r','r','fu','u','SetPersonFrame(rummy.name,0);', 'rumwalk.proceed=true'];");
	rumwalk.ateq("SetPersonScript('rummy', 3, 'rumsbattle.play();');");		//do somethin so this doesn't cause error if you leave the scene and start a diff one
	rumwalk.ateq("remove(rumwalk);");
	
	subevq.push(rumwalk);
	rumwalk.inprog=true;
	rumwalk.proceed=true;
}

function fightyaforit()
{
	rumsbattle.ateq("");
	rumsbattle.ateq("SetPersonScript('rummy', 3, ';'); DetachInput();");
	rumsbattle.ateq("pirate_merch_faceoff();");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(10, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonDirection('rummy', 'west');");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(10, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonX('rummy', GetPersonX('rummy')+4); SetPersonDirection('rummy', 'dukes');");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(5, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("talkjunk(\"MERCHANT: You want my rum? Too bad!\"); dontproceed=true;");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(10, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-4); SetPersonDirection(thePC.name, 'fight2');");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(5, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("talkjunk(\"PIRATE: Arr, I'll fight ya for it!\"); dontproceed=true;");
	rumsbattle.ateq("bgmswitch('music/Ragtime.it', true);");
	//"JUMP" INTO BATTLE!
	rumsbattle.ateq("ziggz = new retard('Ziggy', 'Theif01.rss', true); SetPersonX(ziggz.name, GetPersonX(thePC.name)); SetPersonY(ziggz.name, GetPersonY(thePC.name)); SetPersonDirection(ziggz.name, 'east');");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-6); SetPersonY(ziggz.name,GetPersonY(ziggz.name)-1); SetPersonX('rummy',GetPersonX('rummy')+6); SetPersonY('rummy',GetPersonY('rummy')-1);");
	rumsbattle.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-6); SetPersonY(thePC.name,GetPersonY(thePC.name)-1);");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-6); SetPersonY(ziggz.name,GetPersonY(ziggz.name)-1); SetPersonX('rummy',GetPersonX('rummy')+6); SetPersonY('rummy',GetPersonY('rummy')-1);");
	rumsbattle.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-5); SetPersonY(thePC.name,GetPersonY(thePC.name)-1);");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-6); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+3); SetPersonX('rummy',GetPersonX('rummy')+6); SetPersonY('rummy',GetPersonY('rummy')+3);");
	rumsbattle.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-5); SetPersonY(thePC.name,GetPersonY(thePC.name)+2);");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-4); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+4); SetPersonX('rummy',GetPersonX('rummy')+4); SetPersonY('rummy',GetPersonY('rummy')+4);");
	rumsbattle.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-3); SetPersonY(thePC.name,GetPersonY(thePC.name)+1);");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-4); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+5); SetPersonX('rummy',GetPersonX('rummy')+4); SetPersonY('rummy',GetPersonY('rummy')+5);");
	rumsbattle.ateq("SetPersonX(thePC.name, GetPersonX(thePC.name)-3); SetPersonY(thePC.name,GetPersonY(thePC.name)+2);");
	rumsbattle.ateq("DetachCamera();");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-3); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+5); SetPersonX('rummy',GetPersonX('rummy')+3);");
	rumsbattle.ateq("SetPersonX(ziggz.name, GetPersonX(ziggz.name)-3);");
	rumsbattle.ateq("SetPersonDirection('rummy','battle');");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)-3); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+4); SetPersonX('rummy',GetPersonX('rummy')+3); dontproceed=true;");
	rumsbattle.ateq("battleRT(createenemy(['Rumsfeld',5,99,0,24,45,30,100,10,13,140,60,0,0,'3;'] ,0,0,true,false,true),false, [thePC.name, 'Ziggy'], ['rummy']);");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(10, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonDirection('rummy', 'shocked');");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(30, 'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonDirection('rummy', 'pushed'); getter('mute-1.ogg').play(false);");
	rumsbattle.ateq("SetPersonScript(thePC.name, 4, 'walkgay(thePC, thePC.dirs[thePC.step]);');");
	rumsbattle.ateq("rumsbattle.proceed = false; thePC.dirs = new Array('fr','r','r','r','r','SetPersonDirection(thePC.name, \"unnamed\");', 'rumsbattle.proceed=true;'); thePC.step=0; thePC.mark=0;");
	rumsbattle.ateq("talkjunk('You received \"RUM\"!'); textdraw='smalligan'; dontproceed=true;");
	rumsbattle.ateq("thePC.dirs = new Array('fl','l','l','l','l','SetPersonFrame(thePC.name,0);','fd'); thePC.step=0; thePC.mark=0;");
	rumsbattle.ateq("SetPersonX('passedout', 6*16+7); SetPersonY('passedout', 18*16+7); SetPersonDirection('passedout','crouch');");
	rumsbattle.ateq("SetPersonDirection(ziggz.name,'south');");
	rumsbattle.ateq("passedout.dirs = new Array('w','fl','ul','SetPersonDirection(ziggz.name,\"south\");', 'SetPersonDirection(passedout.name, \"crouch\");','w','fl','ul','SetPersonDirection(passedout.name, \"crouch\");','w','fl','l','SetPersonDirection(passedout.name, \"down1\"); getter(\\'mute-1.ogg\\').play(false);','w','w','w','SetPersonDirection(passedout.name, \"crouch\");','w','fu','u','SetPersonDirection(ziggz.name,\"west\");', ';', 'SetPersonDirection(thePC.name,\"west\");','w','u','fr','w','rumsbattle.proceed=true;');");
	rumsbattle.ateq("rumsbattle.proceed=false; SetPersonScript('passedout', 4, 'walkgay(passedout, passedout.dirs[passedout.step]);');");
	rumsbattle.ateq("talkjunk(\"DUNCAN: That rum is MINE!\"); dontproceed=true;");
	rumsbattle.ateq("rumsbattle.proceed = false; SetPersonSpeed('passedout', 0.5); passedout.dirs = new Array('fr','r','rumsbattle.proceed=true;','ur','fd','w','SetPersonDirection(passedout.name, \"down1\"); getter(\\'mute-1.ogg\\').play(false);','w','w','w','SetPersonDirection(passedout.name, \"crouch\");','rumsbattle.proceed=true;'); passedout.step=0;");
	// DOUBLE JUMP!
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+10); SetPersonY(ziggz.name,GetPersonY(ziggz.name)-5); SetPersonDirection(ziggz.name, 'fight');");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+9); SetPersonY(ziggz.name,GetPersonY(ziggz.name)-4);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+8); SetPersonY(ziggz.name,GetPersonY(ziggz.name)-3);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+7); SetPersonY(ziggz.name,GetPersonY(ziggz.name)-3);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+6); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+1);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+5); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+1);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+4); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+2);");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+7); SetPersonY(thePC.name,GetPersonY(thePC.name)-4); SetPersonDirection(thePC.name, 'fight');");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+3); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+3);");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+6); SetPersonY(thePC.name,GetPersonY(thePC.name)-3);");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+2); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+4);");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+5); SetPersonY(thePC.name,GetPersonY(thePC.name)-2);");
	rumsbattle.ateq("SetPersonX(ziggz.name,GetPersonX(ziggz.name)+2); SetPersonY(ziggz.name,GetPersonY(ziggz.name)+4);");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+4); SetPersonY(thePC.name,GetPersonY(thePC.name)-2);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+3); SetPersonY(thePC.name,GetPersonY(thePC.name)+1);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+2); SetPersonY(thePC.name,GetPersonY(thePC.name)+1);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+2); SetPersonY(thePC.name,GetPersonY(thePC.name)+1);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+1); SetPersonY(thePC.name,GetPersonY(thePC.name)+2);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+1); SetPersonY(thePC.name,GetPersonY(thePC.name)+3);");
	rumsbattle.ateq(";");
	rumsbattle.ateq("SetPersonX(thePC.name,GetPersonX(thePC.name)+1); SetPersonY(thePC.name,GetPersonY(thePC.name)+3); rumsbattle.proceed=false;");
	
	rumsbattle.ateq("talkjunk(\"DUNCAN: Hold/w./w./w./w *hic!*/w/w still!\"); dontproceed=true;");
	rumsbattle.ateq("rumsbattle.proceed = false; passedout.dirs = new Array('fr','w','SetPersonDirection(passedout.name, \"ldowneast\");','w','fr','rumsbattle.proceed=true;'); passedout.step=0; dontproceed=true;");
	rumsbattle.ateq("battleRT(createenemy(['Drunken Duncan',5,200,0,24,45,30,100,10,25,140,60,0,0,'36;'] ,0,0,true,false,true), true, [thePC.name,'Ziggy'], ['passedout']);");
	rumsbattle.ateq("SetPersonDirection('passedout', 'down2'); getter('mute-1.ogg').play(false);");
	//JUNKENING
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(20,'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonDirection(ziggz.name, 'north');");
	rumsbattle.ateq("talkjunk(\"ZIGGY: Yeah! The cap'n is gunna like this!\\nLet's give'im the swag!\"); dontproceed=true;");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(10,'rumsbattle.proceed=true;');");
	rumsbattle.ateq("SetPersonDirection(thePC.name, 'south');");
	rumsbattle.ateq("talkjunk(\"Smitty: Aye.\"); dontproceed=true;");
	rumsbattle.ateq("bgmswitch('music/Albrook.it');");
	rumsbattle.ateq("IgnorePersonObstructions(ziggz.name, true); SetPersonDirection(ziggz.name, 'west');");
	rumsbattle.ateq("rumsbattle.proceed = false; for (var v=0; v<GetPersonX(ziggz.name)-GetPersonX(thePC.name); v++) QueuePersonCommand(ziggz.name, pcml, false); QueuePersonCommand(ziggz.name,pcfu,false); for (var b=0; b<GetPersonY(ziggz.name)-GetPersonY(thePC.name); b++) QueuePersonCommand(ziggz.name,pcmu,false); QueuePersonScript(ziggz.name,'rumsbattle.proceed=true;',false);");
	rumsbattle.ateq("DestroyPerson(ziggz.name);");
	rumsbattle.ateq("AttachInput(thePC.name); AttachCamera(thePC.name);");
	rumsbattle.ateq("SetPersonScript('eighteen', 3, \"talkjunk('BARTENDER: Uh.. I would have given you it for free, of course..');\");");
	rumsbattle.ateq("SetPersonScript('rummy', 3, 'talkjunk(\"MERCHANT: I/w./w. hate/w./w. pirates/w...\");');");
	rumsbattle.ateq("rumsbattle.proceed=false; SetDelayScript(5, 'rumsbattle.proceed=true;');");
	//	rumsbattle.ateq("eventinprog = 'pause'; proceed = false;");
	rumsbattle.ateq("rumsbattle.happened = true; remove(rumsbattle);");
	
	rumsbattle.inprog=true;
	rumsbattle.proceed=true;
	subevq.push(rumsbattle);

}

function swagrindrunks()
{
	pirateparty.ateq("");
	pirateparty.ateq("dontproceed=true; dispTown=false;");		//fadeIn interferes (warpmap)
	pirateparty.ateq("timewarping.nofadepro = true;");			//fadeIn interferes grr
	pirateparty.ateq("DetachInput(); SetPersonSpeed(thePC.name, 1); timewarping.nofadepro=false;");
	pirateparty.ateq("SetPersonScript(thePC.name, 4, 'walkgay(thePC, thePC.dirs[thePC.step]);');");
	pirateparty.ateq("thePC.dirs = ['fl','w','l','l','l','l','l','l','l','l', 'SetPersonFrame(thePC.name, 0);']; thePC.step=0; thePC.mark=0;");
	pirateparty.ateq("pirateparty.proceed = false; DetachCamera(); dontproceed=true; camerapanx(18*16+7, 1);");
	pirateparty.ateq("talkjunk(\"PIRATE: Look who's here!\"); dontproceed=true;");
	pirateparty.ateq("pirateparty.proceed = false; SetDelayScript(15, 'pirateparty.proceed=true;');");
	pirateparty.ateq("talkjunk(\"CAPTAIN CRASH: Have ye completed\\nyer errand?\"); dontproceed=true;");
	pirateparty.ateq("pirateparty.proceed = false; SetDelayScript(15, 'pirateparty.proceed=true;');");
	pirateparty.ateq("talkjunk(\"SMITTY: Yes, captain. A full bottle o' rum!\"); dontproceed=true;");
	pirateparty.ateq("pirateparty.proceed = false; SetDelayScript(15, 'pirateparty.proceed=true;');");
	pirateparty.ateq("SetPersonScript(crash.name, 4, 'if (crash.step > crash.dirs.length) crash.step=0; walkgay(crash, crash.dirs[crash.step]);'); SetPersonDirection(crash.name, 'laugh');");
	pirateparty.ateq("crash.dirs = ['SetPersonFrame(crash.name, 1);', ';', ';', ';', ';', ';', ';', 'SetPersonFrame(crash.name, 0);', ';', ';', ';', ';', ';', ';']; crash.step=0; crash.mark=0;");
	pirateparty.ateq("talkjunk(\"CRASH: HARR Harr! /wBring it here!\"); dontproceed=true;");
	pirateparty.ateq("pirateparty.proceed = false; SetDelayScript(10, 'pirateparty.proceed=true;');");
	pirateparty.ateq("pirateparty.proceed = false; SetPersonDirection(thePC.name, 'south'); for (var f=0; f<=11; f++) QueuePersonCommand(thePC.name, pcmd, false); QueuePersonScript(thePC.name, 'pirateparty.proceed=true;', false);");
	pirateparty.ateq("pirateparty.proceed = false; thePC.dirs = ['d','d','fl','l','l','l','l','l','l','l','fu','u','u','pirateparty.proceed=true;']; thePC.step=0; thePC.mark=0;");
	pirateparty.ateq("dontproceed=true; fadeOutScreen();");
	pirateparty.ateq("blackout=true; dispTown=false; ");
	pirateparty.ateq("eventBox['prechase'].happened = true;");
	pirateparty.ateq("DestroyPerson(thePC.name); thePC.name=''; ChangeMap('Albrook.rmp'); NightBrook(); DestroyPerson('loader'); people=GetPersonList(); dispTown=false;");
	pirateparty.ateq("bgmswitch('music/crickets_loop_004.wav');");
	pirateparty.ateq("SetCameraX(44*16+7); SetCameraY(110*16+7);");
	pirateparty.ateq("dontproceed = true;  fadeInScreen(); camerapanx(24*16+7, 1);");	//fade proceeds 
	pirateparty.ateq("dontproceed=true; pirateparty.proceed=false;");	//don't pro after pan
	pirateparty.ateq("pirateparty.proceed = false; SetDelayScript(80, 'pirateparty.proceed=true;');");
	pirateparty.ateq("blackout = true; eventBox['prechase'].inprog = false;");
	pirateparty.ateq("remove(pirateparty); eventBox['scene1'].play();");
	
	pirateparty.proceed=true;
	pirateparty.inprog = true;
	subevq.push(pirateparty);
}

function lunchbreak2()
{
	SetUpdateScript("updation();");
	eavesdrop.ateq("");
	eavesdrop.ateq("ClearPersonCommands(thePC.name); DetachInput(); walking=false; SetPersonFrame(thePC.name,0); DetachCamera();");
	//K blinks or takes notice, somethin
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(30, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'south');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(30, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'blink');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(10, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'south');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(10, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'blink');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(10, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'south');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(10, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'blink');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(10, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'south');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(10, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("eavesdrop.proceed=false;if (Math.abs(GetPersonX('Kefka') - 19*16+7) > Math.abs(GetPersonY('Kefka') - 47*16+7)) camerapanx(19*16+7, 1); else camerapany(47*16+7,1); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(40, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("if (map2screenY(GetPersonY('manA')) < 160) winy=173;");
	eavesdrop.ateq("talkjunk('MAN A: So... /wHow\\'s business?'); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("talkjunk('MAN B: Not bad.'); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("talkjunk('MAN A: Remember that rich man who got\\nmugged yesterday?'); dontproceed=true;");
	eavesdrop.ateq("talkjunk('MAN B: Fitzgerald?'); dontproceed=true;");
	eavesdrop.ateq("talkjunk('MAN A: Yea.. /wThis morning I saw him\\nhigh-tail it out of Albrook.'); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("talkjunk('MAN B: Haha.. /wstraight back to Tzen.  /wHe\\nmust have heard of the jailbreak. /wEven his\\nridiculous fortune can\\'t buy safety from\\nthat violent madman.'); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("talkjunk('MAN A: Yeah I love this town. /wLet\\'s get\\nsome lunch.'); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("eavesdrop.proceed=false;if (Math.abs(GetPersonX('Kefka') - 19*16+7) > Math.abs(GetPersonY('Kefka') - 47*16+7)) camerapanx(GetPersonX('Kefka'), 1); else camerapany(GetPersonY('Kefka'),1); dontproceed=true;");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'anger');");
	for (var f=0; f<6; f++)	//1
	eavesdrop.ateq("SetPersonY('Kefka', GetPersonY('Kefka')-2);");
	for (var f=0; f<6; f++)
	eavesdrop.ateq("SetPersonY('Kefka', GetPersonY('Kefka')+2);");
	for (var f=0; f<6; f++)	//2
	eavesdrop.ateq("SetPersonY('Kefka', GetPersonY('Kefka')-2);");
	for (var f=0; f<6; f++)
	eavesdrop.ateq("SetPersonY('Kefka', GetPersonY('Kefka')+2);");
	for (var f=0; f<6; f++)	//3
	eavesdrop.ateq("SetPersonY('Kefka', GetPersonY('Kefka')-2);");
	for (var f=0; f<6; f++)
	eavesdrop.ateq("SetPersonY('Kefka', GetPersonY('Kefka')+2);");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	
	eavesdrop.ateq("talkjunk('KEFKA: Tzen!! /wI\\'ll get that chicken wuss! \\n/wHe went to Tzen.. /w/wI must find him!'); dontproceed=true;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'south');");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("SetPersonDirection('Kefka', 'north'); winy=ybo-2;");
	eavesdrop.ateq("eavesdrop.proceed=false; SetDelayScript(20, 'eavesdrop.proceed=true;');");
	eavesdrop.ateq("AttachInput('Kefka'); AttachCamera('Kefka'); eventBox['eavesdropped'].happened = true; remove(eavesdrop);");
	
	eavesdrop.proceed=true;
	eavesdrop.inprog = true;
	subevq.push(eavesdrop);
}


function farman_sprinkle(map, xset, yset)
{
	remove(timewarping);
	farmandog.ateq("");
	farmandog.ateq("DetachInput();");
	farmandog.ateq("farmandog.proceed=false; camerapand(GetPersonX('tzeng'), GetPersonY('tzeng'), 1); dontproceed=true;");
	farmandog.ateq("farmandog.proceed=false; camerapanx(GetPersonX('tzeng'), 1); dontproceed=true;");
	farmandog.ateq("farmandog.proceed=false; camerapany(GetPersonY('tzeng'), 1); dontproceed=true;");
	//DOG INVESTIGATES MWAHAHA
	farmandog.ateq("spike.dirs = []; ClearPersonCommands('spike'); IgnoreTileObstructions('spike', true); IgnorePersonObstructions('spike', true);");
	farmandog.ateq("var SXD = (GetPersonX('tzeng') - GetPersonX('spike'))-16; QueuePersonCommand('spike', COMMAND_FACE_EAST, false); for (var i=0; i<SXD; i++) QueuePersonCommand('spike', COMMAND_MOVE_EAST, false); QueuePersonScript('spike', 'farmandog.proceed=true;',false); farmandog.proceed=false;");
	farmandog.ateq("var SYD = (GetPersonY('tzeng') - GetPersonY('spike'))-4; QueuePersonCommand('spike', (SYD>0)?COMMAND_FACE_SOUTH : COMMAND_FACE_NORTH, false); for (var i=0; i<SYD; i++) QueuePersonCommand('spike', (SYD>0)?COMMAND_MOVE_SOUTH : COMMAND_MOVE_NORTH, false); QueuePersonScript('spike', 'farmandog.proceed=true;', false); farmandog.proceed=false;");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(10, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'east');");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(25, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'sniff');");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(25, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'east');");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(25, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'sniff');");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(25, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'east');");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(25, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'west'); SetPersonX('spike', GetPersonX('spike')+4);");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(25, 'farmandog.proceed=true;');");
	farmandog.ateq("SetPersonDirection('spike', 'peeing');");
	farmandog.ateq("farmandog.proceed=false; SetDelayScript(100, 'farmandog.proceed=true;');");
	farmandog.ateq("dontproceed=true; fadeOutScreen();");
	farmandog.ateq("blackout = true;");
	farmandog.ateq("ChangeMap('" + map + "'); people = GetPersonList();");
	farmandog.ateq("thempa = '" + map + "'; if (thempa=='Tzenrichyrich.rmp') bgmswitch('music/Fitzgerald.it', false, true);");
	farmandog.ateq("AttachCamera(thePC.name); AttachInput(thePC.name);");
	farmandog.ateq("SetPersonX(thePC.name," + xset + "); SetPersonY(thePC.name," + yset + ");");
	farmandog.ateq("SetPersonDirection(thePC.name, 'south');");
	farmandog.ateq("dontproceed=true; fadeInScreen(); walking = false; farmandog.inprog = false; idletime = GetTime(); checkidle = true; remove(farmandog);");
	farmandog.inprog = true;
	farmandog.proceed = true;
	subevq.push(farmandog);

}


function tellthemech()
{
	SetUpdateScript("updation();");
	findanotherway.ateq("");
	findanotherway.ateq("DetachInput(); ClearPersonCommands(thePC.name)");
	findanotherway.ateq("talkjunk('VICKS: Denied!'); dontproceed=true;");
	findanotherway.ateq("talkjunk('VICKS: We gotta find another way down\\nhere.'); dontproceed=true;");
	findanotherway.ateq("findanotherway.inprog = false; remove(findanotherway);AttachInput(thePC.name);");
	findanotherway.inprog = true;
	findanotherway.proceed=true;
	subevq.push(findanotherway);
}

function pushthatmtekbaby()
{
	remove(timewarping);
	getter('die.ogg').setPitch(1.75);
	tek = new retard("Tek", "Magitek.rss", true); SetPersonX('Tek', 33*16+7); SetPersonY('Tek', 17*16+7); SetPersonDirection('Tek', 'empty');
	mechan = new retard("Grease", "Mechanic.rss", true); SetPersonX('Grease', 33*16+7); SetPersonY('Grease', 16.25*16+7); SetPersonDirection('Grease', 'south'); SetPersonLayer('Grease', 1);
	SetPersonScript('Grease', 4, "if (mechan.step>mechan.dirs.length) mechan.step=0; walkgay(mechan, mechan.dirs[mechan.step]);");
	mechan.dirs = ['u','w','u','w','SetPersonSpeed(mechan.name, 2);', 'd', 'SetPersonY(tek.name, GetPersonY(tek.name)+3); SetPersonY(mechan.name, GetPersonY(mechan.name)+3); SetPersonDirection(mechan.name, "down1"); getter("die.ogg").stop(); getter("die.ogg").play(false); SetPersonSpeed(mechan.name, 1);', 'w','fd','w'];
	pushmtek.ateq("");
	pushmtek.ateq("DetachInput();");
	
	pushmtek.ateq("camerapand(33*16+7, 17*16+7, [1,2]); dontproceed=true; pushmtek.proceed=false;");
	pushmtek.ateq("camerapany(17*16+7, 2); dontproceed=true; pushmtek.proceed=false;");
	pushmtek.ateq("pushmtek.proceed=false; SetDelayScript(325, 'pushmtek.proceed=true;');");
	pushmtek.ateq("camerapand(GetPersonX(thePC.name), GetPersonY(thePC.name), [1,2]); dontproceed=true; pushmtek.proceed=false;");
	pushmtek.ateq("camerapany(GetPersonY(thePC.name), 2); pushmtek.proceed=false; dontproceed=true;");
	pushmtek.ateq("fadeOutScreen(); dontproceed=true;");
	pushmtek.ateq("ChangeMap('Trishop.rmp'); blackout=true;");
	
	pushmtek.ateq("getter('die.ogg').setPitch(1.0);");
	pushmtek.ateq("pushmtek.inprog=false; pushmtek.happened=true; remove(pushmtek); eventBox['vicks_swindle'].play();");
	
	pushmtek.inprog=true;
	pushmtek.proceed=true;
	subevq.push(pushmtek);
}

function renchyturtle()
{
	SetPersonScript('renchy', 3, ";");
	DetachInput();
	ClearPersonCommands(thePC.name); SetPersonFrame(thePC.name, 0);
	
	//turtle is at 11,26!
	turtlelude.proceed = false;
	
	if (GetPersonDirection(thePC.name) == "west")
	{
		QueuePersonCommand(thePC.name, pcfd, false);					//fd
		for (var p=0; p<((27*16+7) - GetPersonY(thePC.name)); p++)
			QueuePersonCommand(thePC.name, pcmd, false);				//md
		QueuePersonCommand(thePC.name, pcfl, false);					//fw
		for (var p=0; p<(GetPersonX(thePC.name) - (10*16+7)); p++)
			QueuePersonCommand(thePC.name, pcml, false);				//ww
		QueuePersonCommand(thePC.name, pcfu, false);					//fu
		for (var p=0; p<16; p++)
			QueuePersonCommand(thePC.name, pcmu, false);				//wu
		QueuePersonCommand(thePC.name, pcfr, false);					//fe
		QueuePersonScript(thePC.name, 'SetPersonFrame(thePC.name, 0);', false);
		QueuePersonScript(thePC.name, 'turtlelude.proceed=true;', false);
	}
	else if (GetPersonDirection(thePC.name) == "south")
	{
		QueuePersonCommand(thePC.name, pcfl, false);
		for (var p=0; p<(GetPersonX(thePC.name) - (10*16+7)); p++)
			QueuePersonCommand(thePC.name, pcml, false);
		QueuePersonCommand(thePC.name, pcfd, false);
		for (var p=0; p<((26*16+7) - GetPersonY(thePC.name)); p++)
			QueuePersonCommand(thePC.name, pcmd, false);
		QueuePersonCommand(thePC.name, pcfr, false);
		QueuePersonScript(thePC.name, 'SetPersonFrame(thePC.name, 0);', false);
		QueuePersonScript(thePC.name, 'turtlelude.proceed=true;', false);
	}
	else if (GetPersonDirection(thePC.name) == "north")
	{
		QueuePersonCommand(thePC.name, pcfl, false);
		for (var p=0; p<(GetPersonX(thePC.name) - (10*16+7)); p++)
			QueuePersonCommand(thePC.name, pcml, false);
		QueuePersonCommand(thePC.name, pcfu, false);
		for (var p=0; p<(GetPersonY(thePC.name) - (26*16+7)); p++)
			QueuePersonCommand(thePC.name, pcmu, false);
		QueuePersonCommand(thePC.name, pcfr, false);
		QueuePersonScript(thePC.name, 'SetPersonFrame(thePC.name, 0);', false);
		QueuePersonScript(thePC.name, 'turtlelude.proceed=true;', false);
	}
	else //if (GetPersonDirection(thePC.name) == "east");
	{
		var alignyee = GetPersonY(thePC.name) - (26*16+7);
		if (alignyee == 0) {turtlelude.proceed=true;}
		else
		{
		QueuePersonCommand(thePC.name, (alignyee > 0) ? pcfu : pcfd, false);
		for (var p=0; p<Math.abs(alignyee); p++)
			QueuePersonCommand(thePC.name, (alignyee > 0) ? pcmu : pcmd, false);
		QueuePersonCommand(thePC.name, pcfr, false);
		QueuePersonScript(thePC.name, 'SetPersonFrame(thePC.name, 0);', false);
		QueuePersonScript(thePC.name, 'turtlelude.proceed=true;', false);
		}
	}
	
	
	turtlelude.ateq("");
	turtlelude.ateq("if (party[0] != 'Vicks') { var xy=GetPersonX(thePC.name),yx=GetPersonY(thePC.name), lyr=GetPersonLayer(thePC.name); DestroyPerson(thePC.name); thePC = new retard('Vicks', 'Brown.rss', false); SetPersonX(thePC.name, xy);SetPersonY(thePC.name, yx); SetPersonLayer(thePC.name, lyr); SetPersonDirection(thePC.name, 'west'); people = GetPersonList(); party=['Vicks','Greasemonk'];}");
	turtlelude.ateq("grease = new retard('grease', 'Mechanic.rss', true); SetPersonX('grease',GetPersonX(thePC.name)); SetPersonY('grease', GetPersonY(thePC.name));");
	turtlelude.ateq("SetPersonScript('grease', 4, 'walkgay(grease, grease.dirs[grease.step]);');");
	turtlelude.ateq("IgnorePersonObstructions('grease', true); grease.dirs = ['fu','u','fr','w','turtlelude.proceed=true;']; turtlelude.proceed=false;");
	turtlelude.ateq("talkjunk('VICKS: Your lucky wrench happened to land\\non this turtle\\'s shell! /wWhat are the odds?'); dontproceed=true;");
	turtlelude.ateq("grease.dirs = ['r','fd','w','w','w','turtlelude.proceed=true;']; turtlelude.proceed=false; grease.step=0; grease.mark=0;");
	turtlelude.ateq("talkjunk('MECHANIC: ./w/w...Yup.'); dontproceed=true;");
	turtlelude.ateq("turtlelude.proceed=false; SetDelayScript(50, 'turtlelude.proceed=true;');");
	turtlelude.ateq("talkjunk('VICKS: Well, /wyou gunna grab it?'); dontproceed=true;");
	turtlelude.ateq("turtlelude.proceed=false; SetDelayScript(25, 'turtlelude.proceed=true;');");
	turtlelude.ateq("talkjunk('MECHANIC: It\\'s all covered in slime!/w You\\ngrab it.'); dontproceed=true;");
	turtlelude.ateq("turtlelude.proceed=false; SetDelayScript(25, 'turtlelude.proceed=true;');");
	turtlelude.ateq("talkjunk('VICKS: You work with grease everyday!'); IgnoreTileObstructions('renchy', true);");
	turtlelude.ateq("SetPersonSpeed('renchy', 2); for (var g=0; g<16; g++) QueuePersonCommand('renchy', pcmr, false); QueuePersonScript('renchy', 'SetPersonY(renchy.name, GetPersonY(renchy.name)+8); SetPersonDirection(renchy.name, \\'swimeast\\');', false); QueuePersonScript('renchy', 'turtlelude.proceed=true;', false); turtlelude.proceed=false;");
	turtlelude.ateq("SetPersonDirection('grease', 'east');");
	turtlelude.ateq("SetPersonSpeed('renchy', 1); renchy.dirs = ['r','r','SetPersonDirection(renchy.name, \\'swimnorth\\');', 'u','u','SetPersonDirection(renchy.name, \\'swimeast\\');', 'r','r','r','r' ,'turtlelude.proceed=true;']; turtlelude.proceed=false; renchy.step=0; renchy.mark=0;");
	turtlelude.ateq("turtlelude.proceed=false; SetDelayScript(50, 'turtlelude.proceed=true;');");
	turtlelude.ateq("talkjunk('MECHANIC: It just swam to the other end\\nof the sewers.'); dontproceed=true;");
	turtlelude.ateq("turtlelude.proceed=false; SetDelayScript(15, 'turtlelude.proceed=true;');");
	turtlelude.ateq("talkjunk('VICKS: Alright, let\\'s follow it. /wNo big deal.'); dontproceed=true;");
	turtlelude.ateq("grease.dirs = ['fd','d','fl','l','turtlelude.proceed=true;']; turtlelude.proceed=false; grease.step=0; grease.mark=0;");
	turtlelude.ateq("DestroyPerson('grease'); SetPersonDirection(thePC.name, 'north'); remove(turtlelude); turtlelude.happened=true; turtlelude.inprog=false; AttachInput(thePC.name);");

	turtlelude.inprog = true;
	subevq.push(turtlelude);
}

function noticeturtle()
{
	DestroyPerson('scenetrig321'); DestroyPerson('scenetrig322'); people=GetPersonList();
	DetachInput(); ClearPersonCommands(thePC.name); SetPersonFrame(thePC.name, 0);
//return;
	scenetrig321_bX14.ateq("");
	scenetrig321_bX14.ateq("DetachCamera();");
	scenetrig321_bX14.ateq("scenetrig321_bX14.proceed=false; camerapany(GetPersonY('turtle3')-32,1); dontproceed=true;");
	scenetrig321_bX14.ateq("scenetrig321_bX14.proceed=false; SetDelayScript(25, 'scenetrig321_bX14.proceed=true;');");
	scenetrig321_bX14.ateq("winy = 173;");
	scenetrig321_bX14.ateq("talkjunk('VICKS: There\\'s that slippery reptile..'); dontproceed=true;");
	scenetrig321_bX14.ateq("if (party[0] != 'Vicks') { var xy=GetPersonX(thePC.name),yx=GetPersonY(thePC.name), lyr=GetPersonLayer(thePC.name); DestroyPerson(thePC.name); thePC = new retard('Vicks', 'Brown.rss', false); SetPersonX(thePC.name, xy);SetPersonY(thePC.name, yx); SetPersonLayer(thePC.name, lyr); SetPersonDirection(thePC.name, 'west'); people = GetPersonList(); party=['Vicks','Greasemonk'];}");
	scenetrig321_bX14.ateq("grease = new retard('grease', 'Mechanic.rss', true); SetPersonX('grease',GetPersonX(thePC.name)); SetPersonY('grease', GetPersonY(thePC.name));");
	scenetrig321_bX14.ateq("SetPersonScript('grease', 4, 'walkgay(grease, grease.dirs[grease.step]);');");
	scenetrig321_bX14.ateq("IgnorePersonObstructions('grease', true); grease.dirs = ['fd','d','w','scenetrig321_bX14.proceed=true;']; scenetrig321_bX14.proceed=false;");
	scenetrig321_bX14.ateq("scenetrig321_bX14.proceed=false; SetDelayScript(25, 'scenetrig321_bX14.proceed=true;');");
	scenetrig321_bX14.ateq("talkjunk('MECHANIC: Can\\'t reach it from here..'); dontproceed=true;");
	scenetrig321_bX14.ateq("grease.dirs = ['fu','u','scenetrig321_bX14.proceed=true;']; scenetrig321_bX14.proceed=false; grease.step=0; grease.mark=0;");
	scenetrig321_bX14.ateq("DestroyPerson('grease'); winy = ybo-3; people=GetPersonList();");
	scenetrig321_bX14.ateq("scenetrig321_bX14.proceed=false; camerapany(GetPersonY(thePC.name), 1); dontproceed=true;");
	scenetrig321_bX14.ateq("AttachInput(thePC.name); AttachCamera(thePC.name); remove(scenetrig321_bX14); scenetrig321_bX14.inprog = false; scenetrig321_bX14.happened = true;");
	
	
	
	scenetrig321_bX14.proceed=true;
	scenetrig321_bX14.inprog=true;
	subevq.push(scenetrig321_bX14);

}



